/*
Copyright (C) 2022-2024 Inspur Corp.

SPDX-License-Identifier: Apache-2.0
*/
package router

import (
	"github.com/emicklei/go-restful"
	"icep/auth"
	"icep/controller"
	"icep/router/wsreg"
)

func Route(container *restful.Container, controller *controller.IcepController) {
	wsUnLogin := new(restful.WebService)
	wsreg.RegisterUnLoginWebService(wsUnLogin, controller)
	container.Add(wsUnLogin)

	ws := new(restful.WebService)
	ws.Filter(auth.AuthFilter)
	wsreg.RegisterUserManageWebService(ws, controller)
	wsreg.RegisterDataEvidenceWebService(ws, controller)
	wsreg.RegisterFileEvidenceWebService(ws, controller)
	wsreg.RegisterRealNamePersonWebService(ws, controller)
	wsreg.RegisterMenuManageWebService(ws, controller)
	wsreg.RegisterRealNameOrgWebService(ws, controller)
	wsreg.RegisterObtainEvidenceWebService(ws, controller)

	wsreg.RegisterDebugWebService(ws, controller)
	container.Add(ws)
}
